int bin_search(int arr[], int left, int right, int key)
{
	while (left <= right )
	{
		int mid = (left + right) / 2;
		if (arr[mid] > key)
			right = mid - 1;
		else if (arr[mid] < key)
			left = mid + 1;
		else
			return mid;
	}
	return -1;
}
